package com.gem.demo.mvc;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//mvc的配置类
@Configuration
public class WebMvc implements WebMvcConfigurer {
    /*
    * @Param registry
    * registry 给指定的页面添加controller
    * */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
// http://localhost:8088/Book-->login.html
        //默认视图解析器    templates
        registry.addViewController("/").setViewName("login");
        registry.addViewController("/toLogin").setViewName("login");
    }
}
